package com.hotel.ssm.service;


import com.github.pagehelper.PageHelper;
import com.hotel.ssm.dao.ISysLogDao;
import com.hotel.ssm.domain.SysLog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;

import java.util.Collection;
import java.util.Collections;
import java.util.List;

@Service
@Transactional
public class SysLogService implements ISysLogService {

    @Autowired
    private ISysLogDao sysLogDao;

    @Override
    public List<SysLog> findAll(int page, int size) throws Exception {
        //参数pageNum是页码，pageSize是每页显示条数
        PageHelper.startPage(page, size);
        List<SysLog> sysLogs = sysLogDao.findAll();
        return sysLogs;
    }

    @Override
    public void save(SysLog sysLog) throws Exception {
        sysLogDao.save(sysLog);
    }
}
